import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
from TestRunner import HTMLTestRunner
from auto_mail import mail
from sys_config.sys_config import config_info

if __name__ == "__main__":
    test_dir = "../test/"
    pattern = "test*.py"
    suite = unittest.defaultTestLoader.discover(test_dir, pattern)

    html_url = config_info.get_Report_dir()
    f = open(html_url, "wb")
    runner = HTMLTestRunner(stream=f, title="自动化测试报告", description="运行环境：Windows10，Chrome浏览器")
    runner.run(suite)
    f.close()
    mail.auto_send_mail(html_url, "1563010793@qq.com")
    mail.auto_send_mail(html_url, "1011922670@qq.com")
